package org.jadapter.examples.foobar;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestFooBar {

    @Test public void shouldWorkUsingTransformer() {
        ApplicationContext ctx = new ClassPathXmlApplicationContext
            ("org/jadapter/examples/foobar/adapters.xml");
        
        Foo foo = new Foo();
        foo.setFoo(42);
                    
        UsesTransformer ub = (UsesTransformer)ctx.getBean("usesTransformer");
        ub.doStuffUsingTransformer(foo);
        

    }
    
    @Test public void shoudlWorkUsingRegistry() {
        ApplicationContext ctx = new ClassPathXmlApplicationContext
            ("org/jadapter/examples/foobar/adapters.xml");
        
        Foo foo = new Foo();
        foo.setFoo(42);
        
        UsesRegistry ur = (UsesRegistry)ctx.getBean("usesRegistry");
        ur.doStuffUsingTransformer(foo);
        

    }

    
    
    
    
}
